using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace PCR.Converter
{
    public class BoolVisibleConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is int)
            {
                return (!(value.ToString() == parameter.ToString())) ? Visibility.Collapsed : Visibility.Visible;
            }
            return (!System.Convert.ToBoolean(value)) ? Visibility.Collapsed : Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}
